<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    //return $router->app->version();
    echo '<div style="margin-top: 10%; text-align: center;">';
    echo '<h2>病友圈项目</h2>';
    echo '<a href="/admin" style="color: #0088CC;">后台</a><br><br>';
    echo '<a href="https://lxw7.w.eolink.com/home/api-studio/inside/AP1VLJH025a8f6b29269f83ed63eecf49bad075a198c798/api/3070728/detail/55048652?spaceKey=lxw7" target="_blank" style="color: #0088CC;">接口文档</a>';
    echo '</div>';
    exit;
});


//后台接口
$router->group(['prefix'=>'api/admin', 'namespace'=>'ApiAdmin'], function () use ($router) {
    $router->post('login', 'LoginController@dologin');
    //管理员
    $router->post('admin/index', 'AdminController@getIndex');
    $router->post('admin/one', 'AdminController@getOne');
    $router->post('admin/modify', 'AdminController@modify');
    $router->post('admin/pwd', 'AdminController@setPwd');
    $router->post('admin/del', 'AdminController@del');
    $router->post('admin/able', 'AdminController@able');
    //配置
    $router->post('config/index', 'ConfigController@getIndex');
    $router->post('config/modify', 'ConfigController@modify');
    //图片上传
    $router->post('image/upload', 'ImageController@upload');
    $router->post('image/list', 'ImageController@getList');
    $router->post('video/upload', 'ImageController@uploadVideo');
    //分类
    $router->post('cate/index', 'CateController@getIndex');
    $router->post('cate/modify', 'CateController@modify');
    $router->post('cate/del', 'CateController@del');
    //医院
    $router->post('yiyuan/index', 'YiyuanController@getIndex');
    $router->post('yiyuan/one', 'YiyuanController@getOne');
    $router->post('yiyuan/modify', 'YiyuanController@modify');
    //用户
    $router->post('user/index', 'UserController@getIndex');
    $router->post('user/one', 'UserController@getOne');
    $router->post('user/modify', 'UserController@modify');
    $router->post('user/auth/real', 'UserController@authReal');
    $router->post('user/able', 'UserController@able');
    $router->post('user/del', 'UserController@del');
    //医生
    $router->post('doctor/index', 'DoctorController@getIndex');
    $router->post('doctor/auth', 'DoctorController@auth');
    $router->post('doctor/daiban/list', 'DoctorController@daibanList');
    $router->post('doctor/daiban/modify', 'DoctorController@daibanModify');
    $router->post('doctor/yihu/list', 'DoctorController@yihuList');
    $router->post('doctor/peizhen/list', 'DoctorController@peizhenList');
    //患者
    $router->post('patient/index', 'PatientController@getIndex');
    $router->post('patient/one', 'PatientController@getOne');
    //贴吧
    $router->post('tieba/index', 'TiebaController@getIndex');
    //贴吧
    $router->post('tieba/index', 'TiebaController@getIndex');
    $router->post('tieba/one', 'TiebaController@getOne');
    $router->post('tieba/reply/list', 'TiebaController@replyList');
    //代办
    $router->post('daiban/index', 'DaibanController@getIndex');
    //小区医护
    $router->post('yihu/index', 'YihuController@getIndex');
    $router->post('yihu/one', 'YihuController@getOne');
    //陪诊
    $router->post('peizhen/index', 'PeizhenController@getIndex');
    $router->post('peizhen/one', 'PeizhenController@getOne');
    //咨询
    $router->post('zixun/index', 'ZixunController@getIndex');
    //聊天室
    $router->post('chat/index', 'ChatController@getIndex');
    //财务
    $router->post('chat/index', 'ChatController@getIndex');
    //表情包
    $router->post('emoji/index', 'EmojiController@getIndex');
    $router->post('emoji/modify', 'EmojiController@modify');
    $router->post('emoji/del', 'EmojiController@del');
    //买药问诊
    $router->post('drug/option', 'DrugController@getOption');
    $router->post('drug/index', 'DrugController@getIndex');
    $router->post('drug/one', 'DrugController@getOne');
    $router->post('drug/modify', 'DrugController@modify');
    $router->post('drug/shelf', 'DrugController@shelfModify');
    $router->post('drug/del', 'DrugController@del');
    //药品分类
    $router->post('drug/cate/index', 'DrugController@cateIndex');
    $router->post('drug/cate/modify', 'DrugController@cateModify');
    $router->post('drug/cate/del', 'DrugController@cateDel');
    //药品标签
    $router->post('drug/tag/index', 'DrugController@tagIndex');
    $router->post('drug/tag/modify', 'DrugController@tagModify');
    $router->post('drug/tag/del', 'DrugController@tagDel');
    //买药订单
    $router->post('drug/order/index', 'DrugOrderController@getIndex');
    $router->post('drug/order/send', 'DrugOrderController@send');
    $router->post('drug/order/finish', 'DrugOrderController@finish');
});


//用户端接口
$router->group(['prefix'=>'api/user', 'namespace'=>'ApiUser'], function () use ($router) {
    //用户
    $router->post('regist', 'UserController@regist');
    $router->post('sendyzm', 'UserController@sendYzm');
    $router->post('login', 'UserController@dologin');
    $router->post('loginbyyzm', 'UserController@loginByYzm');
    $router->post('logoff', 'UserController@logoff');
    $router->post('auth/real', 'UserController@authReal'); //实名认证申请
    $router->post('infobytoken', 'UserController@infoByToken'); //获取用户信息
    $router->post('infobyuid', 'UserController@infoByUid'); //获取用户信息
    $router->post('follow/modify', 'UserController@setFollow'); //关注设置
    //健康专栏
    $router->post('healthy/list', 'UserController@healthyList'); //健康专栏列表
    $router->post('healthy/one', 'UserController@healthyOne'); //健康专栏详情
    //提现
    $router->post('tixian/list', 'UserController@tixianList'); //提现列表
    $router->post('tixian/apply', 'UserController@tixianApply'); //提现申请
    $router->post('withdraw/config', 'UserController@getTxConfig'); //提现设置
    //首页
    $router->post('index/gc/list', 'IndexController@gcList'); //首页抢单
    //$router->post('index/unit/price', 'IndexController@unitPrice'); //获取价格
    //$router->post('index/servePrice', 'IndexController@servePrice'); //计算价格
    $router->post('yiyuan/listbykey', 'IndexController@yyListByKey'); //医院搜索
    $router->post('msg/list', 'IndexController@msgList'); //消息提醒
    //图库
    $router->post('image/upload/img', 'ImageController@uploadImg'); //上传图片
    //医生
    $router->post('doctor/list', 'DoctorController@getList'); //列表搜索
    $router->post('doctor/option', 'DoctorController@getOption'); //选项
    $router->post('doctor/apply', 'DoctorController@apply'); //申请
    $router->post('doctor/daiban/list', 'DoctorController@daibanList'); //代办列表
    $router->post('doctor/daiban/one', 'DoctorController@daibanOne'); //代办详情
    //患者病历
    $router->post('patient/list', 'PatientController@getList');
    $router->post('patient/one', 'PatientController@getOne');
    $router->post('patient/add', 'PatientController@add');
    $router->post('patient/modify', 'PatientController@modify');
    //咨询
    $router->post('seek/one', 'SeekController@getOne');
    $router->post('seek/cnt/list', 'SeekController@getCntList');
    $router->post('seek/cnt/doctor/send', 'SeekController@doctorSend');
    $router->post('seek/cnt/patient/send', 'SeekController@patientSend');
    $router->post('seek/bingli/patlist', 'SeekController@patBingliList'); //患者病例列表
    $router->post('seek/bingli/sendoklist', 'SeekController@bingliSendOkList'); //已发送病例列表
    $router->post('seek/bingli/send', 'SeekController@bingliSend'); //发送病例
    //贴吧
    $router->post('tieba/doctor/list', 'TiebaController@doctorList');
    $router->post('tieba/doctor/add', 'TiebaController@doctorAdd');
    $router->post('tieba/list', 'TiebaController@getList');
    $router->post('tieba/one', 'TiebaController@getOne');
    $router->post('tieba/add', 'TiebaController@add');
    $router->post('tieba/del', 'TiebaController@del');
    $router->post('tieba/reply/list', 'TiebaController@replyList');
    $router->post('tieba/reply/add', 'TiebaController@replyAdd');
    $router->post('tieba/reply/like/add', 'TiebaController@replyLikeAdd');
    //代办
    $router->post('daiban/option', 'DaibanController@getOption');
    $router->post('daiban/doctor/list', 'DaibanController@doctorList');
    $router->post('daiban/doctor/one', 'DaibanController@doctorOne');
    $router->post('daiban/doctor/rob', 'DaibanController@doctorRob'); //医生接单
    $router->post('daiban/yiyuan/namebykey', 'DaibanController@yiyuanByKey');
    $router->post('daiban/list', 'DaibanController@getList');
    $router->post('daiban/add', 'DaibanController@add');
    $router->post('daiban/pat/yuyue', 'DaibanController@patYuyue'); //患者预约
    $router->post('daiban/one', 'DaibanController@getOne'); //详情
    //小区医护
    $router->post('yihu/option', 'YihuController@getOption');
    $router->post('yihu/doctor/list', 'YihuController@doctorList');
    $router->post('yihu/doctor/one', 'YihuController@doctorOne');
    $router->post('yihu/yytime/list', 'YihuController@yytimeList');
    $router->post('yihu/add', 'YihuController@add'); //患者发布
    $router->post('yihu/list', 'YihuController@getList'); //医生查看
    $router->post('yihu/doctor/rob', 'YihuController@rob'); //医生接单
    $router->post('yihu/doctor/see', 'YihuController@see'); //医生病情评估
    $router->post('yihu/doctor/todoor', 'YihuController@door'); //医生上门服务
    $router->post('yihu/pat/sure', 'YihuController@sure'); //患者服务确认
    $router->post('yihu/pat/close', 'YihuController@close'); //患者取消
    $router->post('yihu/pat/yuyue', 'YihuController@patYuyue'); //患者预约
    $router->post('yihu/price', 'YihuController@price'); //价格
    $router->post('yihu/one', 'YihuController@getOne'); //详情
    //陪诊
    $router->post('peizhen/list', 'PeizhenController@getList');
    $router->post('peizhen/one', 'PeizhenController@getOne');
    $router->post('peizhen/add', 'PeizhenController@add');
    $router->post('peizhen/doctor/rob', 'PeizhenController@rob'); //医生接单
    $router->post('peizhen/doctor/keep', 'PeizhenController@keep'); //服务开始
    $router->post('peizhen/pat/finish', 'PeizhenController@finish'); //患者服务完成
    $router->post('peizhen/pat/close', 'PeizhenController@close'); //患者取消
    $router->post('peizhen/price', 'PeizhenController@price'); //价格
    //订单
    $router->post('order/list', 'OrderController@getList');
    $router->post('order/yihu/one', 'OrderController@yihuOne');
    $router->post('order/peizhen/one', 'OrderController@peizhenOne');
    //聊天室
    $router->post('chat/list', 'ChatController@getList');
    $router->post('chat/add', 'ChatController@add');
    $router->post('chat/cnt/list', 'ChatController@cntList');
    $router->post('chat/cnt/send', 'ChatController@send');
    $router->post('emoji/list', 'ChatController@emojiList'); //表情包
    //短信
    $router->post('sms/test', 'SmsController@test');
    //微信授权
    $router->post('wx/auth', 'WxAuthController@token');
    $router->post('map/listbylocate', 'WxAuthController@mapByLocate');
    $router->post('map/distance', 'WxAuthController@mapByDistance');
    //我的
    $router->post('myset/price/list', 'MySetController@priceList');
    $router->post('myset/price/modify', 'MySetController@modifyPrice');
    $router->post('myset/daiban/list', 'MySetController@daibanList');
    $router->post('myset/daiban/modify', 'MySetController@modifyDaiban');
    $router->post('myset/yihu/list', 'MySetController@yihuList');
    $router->post('myset/yihu/modify', 'MySetController@modifyYihu');
    $router->post('myset/yihu/add', 'MySetController@yihuAdd');
    $router->post('myset/peizhen/list', 'MySetController@peizhenList');
    $router->post('myset/peizhen/modify', 'MySetController@peizhenModify');
    //收货地址
    $router->post('address/list', 'AddressController@getList');
    $router->post('address/one', 'AddressController@getOne');
    $router->post('address/add', 'AddressController@add');
    $router->post('address/modify', 'AddressController@modify');
    $router->post('address/del', 'AddressController@del');
    //药物
    $router->post('drug/option', 'DrugController@getOption');
    $router->post('drug/list', 'DrugController@getList');
    $router->post('drug/one', 'DrugController@getOne');
    $router->post('drug/order/option', 'DrugController@orderOption');
    $router->post('drug/order/add', 'DrugController@orderAdd');
    //支付
    $router->post('pay/wx/test', 'PayWxController@test');
    $router->post('pay/wx/pay', 'PayWxController@pay');
    $router->post('pay/wx/notice', 'PayWxController@notice');
    $router->post('pay/wx/refund', 'PayWxController@refund');
    $router->post('pay/yu', 'PayYueController@pay');
    $router->post('pay/zfb/test', 'PayZfbController@test');
    $router->post('pay/zfb/pay', 'PayZfbController@pay');
    $router->post('pay/zfb/notice', 'PayZfbController@notice');
    $router->post('pay/zfb/refund', 'PayZfbController@refund');
});